package cn.t16.ms.product;

import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ProductServiceImpl implements ProductService {
    @Resource
    private ProductRepository productRepository;

    @Override
    public List<Product> getAll() {
        return productRepository.findAll();
    }

    @Override
    public Product get(Integer id) {
        return productRepository.getOne(id);
    }

    @Override
    public void save(Product user) {
        productRepository.save(user);
    }
}
